﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2021_5_21
{
    public enum npcType
    { 
        Task,//任务NPC
        Bussins,//商人
        Blacksmith//铁匠
    }
    //铁匠的行为，其它的我不想打了
    public enum action
    { 
        打造,
        强化,
        修补
    }

    #region NPC父类（抽象）
    abstract class NPC
    {
        protected string name;
        protected npcType npcType;

        public string Name { get => name; set => name = value; }
        public npcType NpcType { get => npcType; set => npcType = value; }
        public abstract void Talk();
    }
    #endregion
    #region 任务NPC子类
    class TaskNPC : NPC
    {
        public string taskInfo;
        public TaskNPC(string name, string taskInfo)
        {
            this.npcType = npcType.Task;
            this.Name = name;
            this.taskInfo = taskInfo;
        }
        public override void Talk()
        {
            Console.WriteLine("我是{0},你能帮我{1}吗？",this.name,this.taskInfo);
        }
    }
    #endregion
    #region 商贩NPC子类
    class BussinsNPC : NPC
    {
        public string gods;
        public BussinsNPC(string name, string gods)
        {
            this.name = name;
            this.npcType = npcType.Bussins;
            this.gods = gods;
        }
        public override void Talk()
        {
            Console.WriteLine("我是{0},你要买点{1}吗？", this.name, this.gods);
        }
    }
    #endregion
    #region 铁匠NPC子类
    class Blacksmith : NPC
    {
        public action action;
        public Blacksmith(string name, action action)
        {
            this.name = name;
            this.npcType = npcType.Blacksmith;
            this.action = action;
        }
        public override void Talk()
        {
            Console.WriteLine("我是{0},你要{1}武器吗？", this.name, this.action);
        }
    }
    #endregion
}
